import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import diretivesObj from '@/utils/directives'
// 引入移动端适配插件
import 'amfe-flexible'
import { allChannelListAPI } from '@/api'
import { NavBar, Form, Field, Button, Tabbar, TabbarItem, Icon, Tab, Tabs, Cell, List, PullRefresh, ActionSheet, Popup, Row, Col, Badge, Search, Divider } from 'vant'

Vue.use(Divider)
Vue.use(diretivesObj)
Vue.use(Search)
Vue.use(Badge)
Vue.use(Row)
Vue.use(Col)
Vue.use(Popup)
Vue.use(ActionSheet)
Vue.use(PullRefresh)
Vue.use(List)
Vue.use(Cell)
Vue.use(Tab)
Vue.use(Tabs)

Vue.use(Icon)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Form)
Vue.use(Field)
Vue.use(NavBar)
Vue.use(Button)
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

const myFn = async () => {
  // try catch   监听await错误情况
  // try里写的是正确的await
  try {
    await allChannelListAPI()
    // catch err是回调参数
  } catch (err) {
    console.dir(err)
  }
}
myFn()
